import request from '@/utils/request'
export function listByDoctorId(query) {
  return request({
    url: '/parent/book/listByDoctorId',
    method: 'get',
    params: query
  })
}
// 查询预约列表
export function listBook(query) {
  return request({
    url: '/parent/book/list',
    method: 'get',
    params: query
  })
}
// 查询预约列表(非取消状态)
export function selectBookNoCancel(query) {
  return request({
    url: '/parent/book/selectBookNoCancel',
    method: 'get',
    params: query
  })
}

// 查询预约详细
export function getBook(id) {
  return request({
    url: '/parent/book/' + id,
    method: 'get'
  })
}

// 新增预约
export function addBook(data) {
  return request({
    url: '/parent/book',
    method: 'post',
    data: data
  })
}
// 检查时间片是否已经预约满
export function checkFull(data) {
  return request({
    url: '/parent/book/checkFull',
    method: 'post',
    data: data
  })
}

// 修改预约
export function updateBook(data) {
  return request({
    url: '/parent/book',
    method: 'put',
    data: data
  })
}

// 删除预约
export function delBook(id) {
  return request({
    url: '/parent/book/' + id,
    method: 'delete'
  })
}
